﻿CREATE TABLE [dbo].[LogTarefa] (
    [Id]           INT           IDENTITY (1, 1) NOT NULL,
    [IdUsuario]    INT           NOT NULL,
    [IdLogAcao]    INT           NOT NULL,
    [IdTarefa]     INT           NOT NULL,
    [DataCadastro] DATETIME      DEFAULT (getdate()) NOT NULL,
    [ValorAntigo]  VARCHAR (255) NULL,
    [ValorNovo]    VARCHAR (255) NULL,
    [Excluido]     BIT           DEFAULT ((0)) NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_IdUsuario_Usuario] FOREIGN KEY ([IdUsuario]) REFERENCES [dbo].[Usuario] ([Id]),
    CONSTRAINT [FK_IdLogAcao_Acao] FOREIGN KEY ([IdLogAcao]) REFERENCES [dbo].[LogAcao] ([Id]),
    CONSTRAINT [FK_IdTarefa_Tarefa] FOREIGN KEY ([IdTarefa]) REFERENCES [dbo].[Tarefa] ([Id])
);

